<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改支付通道')" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-channel-edit" th:object="${tPayChannel}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">通道类型：</label>
                <div class="col-sm-8">
                    <select name="type"  class="form-control" th:with="type=${@dict.getType('channel_type')}" required>
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:field="*{type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">通道编码：</label>
                <div class="col-sm-8">
                    <input name="channel" th:field="*{channel}" class="form-control" type="text" readonly required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">通道描述：</label>
                <div class="col-sm-8">
                    <input name="channelDesc" th:field="*{channelDesc}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">请求类型：</label>
                <div class="col-sm-8">
                    <select name="reqType" id="reqType"  class="form-control" th:with="type=${@dict.getType('channle_req_type')}">
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{reqType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否需要在线：</label>
                <div class="col-sm-8">
                    <select name="needOnLine" id="needOnLine"  class="form-control" onchange="changeOnLine()" th:with="type=${@dict.getType('yes_or_no')}">
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:field="*{needOnLine}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group" hidden="hidden" id="login_type_div">
                <label class="col-sm-3 control-label">登录类型：</label>
                <div class="col-sm-8">
                    <select name="loginType" id="loginType"  class="form-control" th:with="type=${@dict.getType('rec_login_type')}" >
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:field="*{loginType}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否需要生成二维码：</label>
                <div class="col-sm-8">
                    <select name="needGenQrcode"  class="form-control" th:with="type=${@dict.getType('yes_or_no')}">
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:field="*{needGenQrcode}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">码队费率：</label>
                <div class="col-sm-8">
                    <input name="userRate" th:field="*{userRate}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否禁用：</label>
                <div class="col-sm-8">
                    <select name="disabled"  class="form-control" th:with="type=${@dict.getType('yes_or_no')}">
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:field="*{disabled}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否浮动：</label>
                <div class="col-sm-8">
                    <select name="fd100"  class="form-control" th:with="type=${@dict.getType('yes_or_no')}">
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:field="*{fd100}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">单笔最小限额：</label>
                <div class="col-sm-8">
                    <input name="limitPerMinMoney"  th:value="${tPayChannel.limitPerMinMoney}/100" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">单笔最大限额：</label>
                <div class="col-sm-8">
                    <input name="limitPerMaxMoney"  th:value="${tPayChannel.limitPerMaxMoney}/100" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否地区分控：</label>
                <div class="col-sm-8">
                    <select name="isArea"  class="form-control" th:with="type=${@dict.getType('yes_or_no')}">
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:field="*{isArea}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否谷歌：</label>
                <div class="col-sm-8">
                    <select name="needGoogle"  class="form-control" th:with="type=${@dict.getType('yes_or_no')}">
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:field="*{needGoogle}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否固定金额：</label>
                <div class="col-sm-8">
                    <select name="isRegularAmount"  class="form-control" th:with="type=${@dict.getType('yes_or_no')}">
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:field="*{isRegularAmount}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">连续失败下线单数：</label>
                <div class="col-sm-8">
                    <input name="limitErrorCount" th:field="*{limitErrorCount}" class="form-control" type="text" >

                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var prefix = ctx + "business/channel";
        $("#form-channel-edit").validate({
            focusCleanup: true
        });

        $('#needOnLine').trigger('change');
        function changeOnLine() {
            if($("#needOnLine").val() =="1"){
                $("#login_type_div").show();
            }else{
                $("#login_type_div").hide();
            }
        }

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-channel-edit').serialize());
            }
        }
    </script>
</body>
</html>